<!--
@license
Copyright 2024 The Model Explorer Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================
-->

<div class="container" [class.hide]="!showPanel()">
  <table>
    <!-- Basics -->
    @if (!hideOp) {
      <tr #item>
        <td><div class="key op-node-key"></div></td>
        <td><div class="label">{{opLabel}}</div></td>
      </tr>
    }
    @if (!hideLayer) {
      <tr #item>
        <td><div class="key group-node-key"></div></td>
        <td><div class="label">{{layerLabel}}</div></td>
      </tr>
    }
    @if (!hideArtificialLayers) {
      <tr *ngIf="hasArtificialLayers" #item>
        <td><div class="key artificial-layer-key"></div></td>
        <td><div class="label">Artificial layer to reduce layout load</div></td>
      </tr>
    }
    <!-- Selected node -->
    @if (showSelectedNodeKey && ((isSelectedNodeGroup && !hideSelectedLayer) || (!isSelectedNodeGroup && !hideSelectedOp))) {
      <tr #item>
        <td>
          <div class="key selected-node-key" [class.group]="isSelectedNodeGroup">
          </div>
        </td>
        <td>
          <div class="label">
            {{selectedItemLabel}}
          </div>
        </td>
      </tr>
    }
    <!-- Identical layer for selected group node -->
    @if (!hideIdenticalLayers) {
      <tr *ngIf="showSelectedNodeKey && isSelectedNodeGroup" #item>
        <td><div class="key identical-group-key"></div></td>
        <td><div class="label">{{identicalLayerLabel}}</div></td>
      </tr>
    }
    <!-- Input/output for selected op node -->
    <ng-container *ngIf="showSelectedNodeKey && !isSelectedNodeGroup">
      @if (!hideInputs) {
        <tr #item>
          <td><div class="key input-key"></div></td>
          <td><div class="label">{{inputsLabel}} (if any)</div></td>
        </tr>
      }
      @if (!hideOutputs) {
        <tr #item>
          <td><div class="key output-key"></div></td>
          <td><div class="label">{{outputsLabel}} (if any)</div></td>
        </tr>
      }
    </ng-container>
    @if (!hideShortcuts) {
      @if (showDivider()) {
        <tr><td colspan="2"><div class="divider"></div></td></tr>
      }
      <!-- Navigation shortcuts -->
      <tr>
        <td><div class="key shortcut">Zoom</div></td>
        <td><div class="label shortcut">Ctrl+Scroll</div></td>
      </tr>
      <tr>
        <td><div class="key shortcut">Pan</div></td>
        <td><div class="label shortcut">Drag or scroll</div></td>
      </tr>
    }
  </table>
</div>
